<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" />
		<title>直播demo</title>
		<link rel="stylesheet" href="https://g.alicdn.com/de/prismplayer/2.8.2/skins/default/aliplayer-min.css" />
		<script charset="utf-8" type="text/javascript" src="https://g.alicdn.com/de/prismplayer/2.8.2/aliplayer-min.js"></script>
		
		<!-- <link rel="stylesheet" type="text/css" href="static/css/aliplayer-min.css"/>
		<script type="text/javascript" src="static/js/aliplayer-min.js"></script> -->
	</head>
	<body>
		<div class="prism-player" id="J_prismPlayer"></div>

		<button type="button" onclick="onChange()">切换视频</button>
		<button type="button" onclick="onChange1()">切换视频</button>
		<script>
			var player = new Aliplayer({
				id: 'J_prismPlayer',
				width: '100%',
				autoplay: true,
				preload: true,
				//支持播放地址播放,此播放优先级最高
				source: 'http://ivi.bupt.edu.cn/hls/cctv1hd.m3u8',
				isLive: true,
			}, function(player) {
				console.log('播放器创建好了。')
			});

			function onChange() {
				player.pause()
				player.loadByUrl('http://ivi.bupt.edu.cn/hls/cctv6hd.m3u8')
				player.play()
			}

			function onChange1() {
				player.pause()
				player.loadByUrl('http://ivi.bupt.edu.cn/hls/cctv3hd.m3u8')
				player.play()
			}
			
		</script>
	</body>
</html>
